<template>
	<view>
		<view class="wrapper">
			<view class="group-box">
				<uv-cell-group :border='false'>
						<!-- <uv-cell icon="setting-fill" title="收货地址管理" isLink :size='12' :titleStyle="{'font-size':'12px'}"></uv-cell> -->
						<uv-cell :border='false' :icon="require('@/common/images/myInfo/12.png')" title="修改登录密码" :titleStyle="{'font-size':'12px'}" url="/pages/myInfo/updatePassword/index" isLink></uv-cell>
				</uv-cell-group>
			</view>
			<!-- <view class="group-box">
				<uv-cell-group :border='false'>
						<uv-cell  :border='false' icon="setting-fill" title="忘记支付密码" isLink :size='12' :titleStyle="{'font-size':'12px'}" url="/page-subpage/setting/forgotPayPassword"></uv-cell>
						<uv-cell :border='false' icon="integral-fill" title="更换手机号" :titleStyle="{'font-size':'12px'}" isLink></uv-cell>
				</uv-cell-group>
			</view> -->
			<!-- <view class="group-box">
				<uv-cell-group :border='false'>
						<uv-cell :border='false' icon="setting-fill" title="语音播报"  :size='12' :titleStyle="{'font-size':'12px'}">
							<template v-slot:value>
								<uv-switch v-model="value" :activeColor='activeColor' :size='16'></uv-switch>
							</template>
						</uv-cell>
				</uv-cell-group>
			</view> -->
		</view>
		<view class="button-box">
			<button class="button" @click="logoutHandle">退出登录</button>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'Setting',
		data() {
			return {
				value: true,
				activeColor:'#7B4EFF'
			};
		},
		computed: {
			user() {
				return this.$store.getters.user || {};
			},
		},
		mounted() {},
		async created() {
			// uni.hideTabBar({});
			// this.user = this.$store.getters.user;
		},
		// 下拉刷新
		async onPullDownRefresh() {
			// this.$store.dispatch('getUserDetail').then(res => {
			// 	uni.stopPullDownRefresh();
			// 	this.$tip.toast('刷新成功!', 'success', 500);
			// });
		},
		methods: {
			logoutHandle() {
				this.$tip.modal({
					title:'退出登录',
					content: '是否确认退出登录?',
					confirmColor:'#353535',
					cancelColor:'#7B4EFF'
				}).then(res => {
					console.log(res);
					this.$store.dispatch('StoreByLogout').then(res => {
						this.$nav.reLaunch({
							path: '/pages/login/index'
						});
					});
				}).catch(res => {
					console.log(res);
				});;
			},
		}
	};
</script>

<style lang="scss" scoped>
	.wrapper{
		padding: $uni-spacing-row-lg;
	}
	.group-box{
		background: #fff;
		border-radius: 10px;
		overflow: hidden; 
		margin-bottom: 15px;
		padding: 0 10px;
	}
	.button-box{
		display: flex;
		justify-content: center;
		
		.button{
			width: 40vw;
			background: $button-linear-bg;
			color: #fff;
			display: inline-block;
			margin: $uni-spacing-col-lg auto;
			padding: 0 $uni-spacing-row-lg;
			font-size: $uni-font-size-base;
		}
	}
</style>